home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
misc
/
yak210sr.lha
/
Yak_2.10_Src
/
WBStartup
/
Clickdrive.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-26
|
1KB
|
54 lines
#include <exec/types.h>
#include <devices/trackdisk.h>
#include <clib/alib_protos.h>
#include <proto/exec.h>
#include "ClickDrive.h"
/*
* Set drive click off if toggle is TRUE
* Set drive click on otherwise
*
*/
__regargs void
SetClickDrive (BOOL toggle)
{
struct IOExtTD *td;
struct MsgPort *po;
struct TDU_PublicUnit *tpu;
long unit;
if (po = CreatePort (NULL, 0))
{
for (unit = 0; unit < 4; unit++)
{
if (td = (struct IOExtTD *) CreateExtIO (po, sizeof (struct IOExtTD)))
{
if (!(OpenDevice ("trackdisk.device", unit, (struct IORequest *) td, 0L)))
{
tpu = (struct TDU_PublicUnit *) td->iotd_Req.io_Unit;
if (toggle==TRUE)
{
/* Stop clicking ! */
tpu->tdu_PubFlags |= TDPF_NOCLICK;
}
else
{
/* Keep on clicking ! */
tpu->tdu_PubFlags &= ~TDPF_NOCLICK;
}
CloseDevice ((struct IORequest *) td);
DeleteExtIO ((struct IORequest *) td);
}
}
}
DeletePort (po);
}
}